<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="KpiEditDlg" widgetVar="KpiEditDialog" modal="true" resizable="false" appendTo="@(body)" header="#{bundle.EditKpiTitle}">
            <h:form id="KpiEditForm">
                <h:panelGroup id="display">
                    <p:panelGrid columns="2" rendered="#{kpiController.selected != null}">
                        <p:outputLabel value="#{bundle.EditKpiLabel_idKpi}" for="idKpi" />
                        <p:inputText id="idKpi" value="#{kpiController.selected.idKpi}" title="#{bundle.EditKpiTitle_idKpi}" required="true" requiredMessage="#{bundle.EditKpiRequiredMessage_idKpi}"/>
                        <p:outputLabel value="#{bundle.EditKpiLabel_descripcion}" for="descripcion" />
                        <p:inputText id="descripcion" value="#{kpiController.selected.descripcion}" title="#{bundle.EditKpiTitle_descripcion}" />
                        <p:outputLabel value="#{bundle.EditKpiLabel_kpi}" for="kpi" />
                        <p:inputText id="kpi" value="#{kpiController.selected.kpi}" title="#{bundle.EditKpiTitle_kpi}" />
                        <p:outputLabel value="#{bundle.EditKpiLabel_fechaModificacion}" for="fechaModificacion" />
                        <p:calendar id="fechaModificacion" pattern="MM/dd/yyyy HH:mm:ss" value="#{kpiController.selected.fechaModificacion}" title="#{bundle.EditKpiTitle_fechaModificacion}" required="true" requiredMessage="#{bundle.EditKpiRequiredMessage_fechaModificacion}" showOn="button"/>
                        <p:outputLabel value="#{bundle.EditKpiLabel_idObjetivoEstrategico}" for="idObjetivoEstrategico" />
                        <p:selectOneMenu id="idObjetivoEstrategico" value="#{kpiController.selected.idObjetivoEstrategico}" required="true" requiredMessage="#{bundle.EditKpiRequiredMessage_idObjetivoEstrategico}">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{objetivoEstrategicoController.itemsAvailableSelectOne}"
                                           var="idObjetivoEstrategicoItem"
                                           itemValue="#{idObjetivoEstrategicoItem}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{kpiController.update}" value="#{bundle.Save}" update="display,:KpiListForm:datalist,:growl" oncomplete="handleSubmit(args, 'KpiEditDialog');"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="KpiEditDialog.hide()"/>
                </h:panelGroup>
            </h:form>
        </p:dialog>

    </ui:composition>
</html>
